/**
 * Created by yyj on 2015/10/28.
 */
$(function(){
    //点击关闭按钮
    $('.press_btn2.Close').click(function(){
        var index = parent.layer.getFrameIndex(window.name);
        parent.$('.checkAll').removeAttr('checked');
        parent.layer.close(index);
    })
    //点击添加按钮
     $('.press_btn1.Keep').click(function(){
        var index = parent.layer.getFrameIndex(window.name);
        var cmpName=$("#cmpName").val().trim();
        var cmpAddress=$("#cmpAddress").val().trim();
        var state=$("#state").val().trim();
        var remark=$("#remark").val().trim();
        var cmpFullName=$("#cmpFullName").val().trim();
        if(cmpName==""||cmpName==null||cmpAddress==""||cmpAddress==null||state==""||state==null){
        	parent.layer.msg('带*号的不能为空！', {time:1300});
        }else{
        	$.ajax({
            url:"insertSysCompany.do",
            type:"post",
            dataType: 'json',
            data:{
                "cmpName":cmpName,
                "cmpAddress":cmpAddress,
                "state":state,
                "remark":remark,
                "cmpFullName":cmpFullName
            },
            success:function(result){
                if(result.data){
                   	parent.paging(1);
                   	parent.$('.checkAll').removeAttr('checked');
                    parent.layer.msg('添加成功', {time:1300});
       			 	parent.layer.close(index);
                }else{
                    parent.layer.msg('添加失败！', {time:1000});
                    $(obj).removeAttr("disabled");
                }
            }
        });
        }
        
        
        
    })
});